package com.lb.pattern;

import java.util.regex.Pattern;

/**
 * @Author: zhangjun
 * @Date: 2020/8/13 16:12
 * @Description:
 */
public class DigitTest {
    public static void main(String[] args) {
        int i = 2;
        System.out.println(Pattern.matches("^\\d+\\.\\d{1,"+i+"}$", "12.522"));
        System.out.println(Pattern.matches("^\\d{1,2}$", "s1"));
    }
}
